package com.jtech.together.model;

import cn.bmob.newim.bean.BmobIMExtraMessage;
import cn.bmob.newim.bean.BmobIMMessage;

/**
 * 同意添加好友请求-扩展消息
 * Created by wuxubaiyang on 2017/5/13.
 */

public class AgreeAddFriendMessage extends BmobIMExtraMessage {
    public static final String MESSAGE_TYPE_AGREE_ADD_FRIEND = "agree";

    private String uid;//最初的发送方
    private Long time;
    private String msg;//用于通知栏显示的内容

    @Override
    public String getMsgType() {
        return MESSAGE_TYPE_AGREE_ADD_FRIEND;
    }

    @Override
    public boolean isTransient() {
        return false;
    }

    /**
     * 判断是否为同意好友的消息
     *
     * @param imMessage
     * @return
     */
    public static boolean isAgreeAddFriend(BmobIMMessage imMessage) {
        return isAgreeAddFriend(imMessage.getMsgType());
    }

    public static boolean isAgreeAddFriend(String type) {
        return MESSAGE_TYPE_AGREE_ADD_FRIEND.equals(type);
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}